<template>
    <ScrollView  :loadCallback="onLoadPage"  :is_end="is_end" :ready_to_load="ready_to_load" :page="page">
      <OrderItem :key="index" :data="item"  v-for="(item,index) of order_list"></OrderItem>
    </ScrollView>
</template>

<script>
  //订单列表
  import { mapState } from 'vuex'
  import  ScrollView from "@/components/common/ScrollView"
  import  OrderItem from "@/components/home/OrderItem"
  export default {
    name: 'orderList',
    data(){
      return {page:1}
    },
    components:{
      ScrollView,
      OrderItem
    },
    created() {

    },
    computed: {
    ...mapState(['order_list','is_end','ready_to_load']),
    },
    methods:{
      onLoadPage(){
        this.$store.dispatch('orderList',this.page++)
      }
    }
  }
</script>

<style lang="stylus" scoped>
  @import '~@/assets/main.styl'

</style>
